Lua/Client/ClientParticleSystem/Static Functions/Create
From JC2-MP Documentation
< Lua | Client | ClientParticleSystem
Returns | ClientParticleSystem |
---|---|
Prototype | ClientParticleSystem.Create(AssetLocation, table arguments) |
Description | No description |
Argument table
Required values
Type
Name
Notes
Vector3
position
Angle
angle
string
path
See here for the complete list of paths
Examples
Create an explosion where you click
particleSystems = {}
Events:Subscribe("MouseDown", function(args)
if args.button ~= 1 then
return
end
local result = Physics:Raycast(
Camera:GetPosition(),
Camera:GetAngle() * Vector3.Forward,
0,
100
)
local spawnArgs = {
position = result.position + result.normal * 0.25,
angle = Angle(),
path = "fx_exp_grenade_01.psm",
}
local particleSystem = ClientParticleSystem.Create(AssetLocation.Game, spawnArgs)
table.insert(particleSystems, particleSystem)
end)
-- Make sure to clean up everything on ModuleUnload.
Events:Subscribe("ModuleUnload", function()
for index, particleSystem in ipairs(particleSystems) do
particleSystem:Remove()
end
end)